#ifndef SCROLLER_H
#define SCROLLER_H

#include <QGraphicsView>

#include <OLFlickAndDrag.h>

class Scroller : public QGraphicsView,
                 public OLFlickAndDragInfoProvider
{
    Q_OBJECT
public:
    explicit Scroller(QWidget *parent = 0);

protected:
    // from QGraphicsView
    virtual void mouseMoveEvent(QMouseEvent* event);
    virtual void mousePressEvent(QMouseEvent* event);
    virtual void mouseReleaseEvent(QMouseEvent* event);
    virtual void resizeEvent(QResizeEvent* event);

    // from OLFlickAndDragInfoProvider
    virtual int scrollValue();
    virtual void setScrollValue(int scrollvalue);
    virtual void handleClick(const QPoint& pos);
    virtual void handleLongPress(const QPoint& pos);
    virtual void handleLeftSwipe();
    virtual void handleRightSwipe();

private:
    OLFlickAndDrag* m_kinetic;
    QScrollBar *m_scrollbar;

};

#endif // SCROLLER_H
